import fetch from './fetch'
let config = {'Content-Type': 'multipart/form-data'}
export default {
  fill: {
    // validateStaffNum (recommendStaffNum = 60781) {  //   员工工号验证
    //   return fetch('/api/mApp/installment/user/v2/validateStaffNum', {recommendStaffNum})
    // },
    getApplyType () {              //  推荐数据回显
      return fetch('/api/mApp/installment/user/v2/getApplyType')
    },
    getRecommendCode (recommendStaffNum = 6078) {          //  员工工号验证发送推荐码
      return fetch('/api/mApp/installment/user/v2/checkStaffNum', {recommendStaffNum}, 'post')
    },
    getArea () {   //   获取地区
      return fetch('/api/installment/area/getArea')
    },
    getCheckIdentity () { //   获取身份信息验证
      return fetch('/api/mApp/installment/user/v2/getCheckIdentity')
    },
    getDictsByType (type = 'installment_user_marriage') {   //   根据type获取下拉字典选项
      return fetch('/api/admin/sysDict/getDictsByType', {type})
    },
    sendValiCode (telephone = 18708733495, type = 1) {  //   发送短信验证码
      return fetch('/api/mApp/installment/user/v2/sendValiCode', {telephone, type}, 'post')
    },
    checkValiCode (code = 1111, telephone = 18708733495) {  //    检查验证码是否正确
      return fetch('/api/mApp/installment/user/v2/checkValiCode', {code, telephone}, 'post')
    },
    checkIdentity (params = {}) {  //   身份信息验证
      return fetch('/api/mApp/installment/user/v2/checkIdentity', params, 'post')
    },
    getBankInfo () {  //   获取银行卡信息
      return fetch('/api/mApp/installment/user/v2/getBankInfo')
    },
    cardRecognize (params = {}) {  //   银行卡拍照识别
      return fetch('/api/mApp/installment/user/v2/cardRecognize', params, 'post', 'payload', config)
    },
    validateBankInfo (bankId = 1, bankName = 11, bankNo = 111, phone = 111) {     //   校验银行卡信息
      return fetch('/api/mApp/installment/user/v2/validateBankInfo', {bankId, bankName, bankNo, phone}, 'post')
    },
    saveBankInfo (code = 1111, bankId = 1, bankName = 11, bankNo = 111, phone = 111) {  //   保存银行卡信息
      return fetch('/api/mApp/installment/user/v2/saveBankInfo', {code, bankId, bankName, bankNo, phone}, 'post')
    },
    getZmxyAuthInfo () {   //   芝麻信用用户授权基本信息
      return fetch('/api/mApp/installment/user/v2/zmxyAuth/getUserInfo')
    },
    getUrlOrSkip (isDoAuthed = true) {    //   获取授权链接或者跳过授权
      return fetch('/api/mApp/installment/user/v2/zmxyAuth/getUrlOrSkip', {isDoAuthed})
    },
    queryAuthResult () {      //   芝麻信用授权结果查询
      return fetch('/api/mApp/installment/user/v2/zmxyAuthed/query')
    },
    getSocialInfo () {  // 获取社交信息
      return fetch('/api/mApp/installment/user/v2/getSocialInfo')
    },
    saveSocialInfo (contacts = []) {           // 保存社交信息
      return fetch('/api/mApp/installment/user/v2/saveSocialInfo', {contacts}, 'post')
    },
    getSchoolInfo () {       // 获取学校信息
      return fetch('/api/mApp/installment/user/v2/getSchoolInfo')
    },
    saveSchoolInfo (params = {}) {       // 保存学校信息
      return fetch('/api/mApp/installment/user/v2/saveSchoolInfo', params, 'post')
    },
    getJobInfo () {        //   获取工作信息
      return fetch('/api/mApp/installment/user/v2/getJobInfo')
    },
    saveJobInfo (params = {}) {         //   保存工作信息
      return fetch('/api/mApp/installment/user/v2/saveJobInfo', params, 'post')
    },
    upload (params = {}) {              // 上传附件
      return fetch('/api/mApp/auditFile/v2/upload', params, 'post', 'payload', config)
    },
    getAttachment (caaFlag = 3) {             //  根据附件类型获取附件列表
      return fetch('/api/mApp/auditFile/v2', {caaFlag})
    },
    saveAttachment (params = {}) {           //   保存上传的附件
      return fetch('/api/mApp/auditFile/v2', params, 'post', 'payload', config)
    },
    submitManual () {          //  提交人工审核
      return fetch('/api/mApp/installment/user/v2/submitManual', {}, 'post')
    },
    getQuota () {
      return fetch('/api/mApp/installment/user/v2/getQuota', {}, 'post')
    }
  },
  sign: {
    getSignUrl (type = 1) {
      return fetch('/api/fdd/getSignUrl', {type})
    }
  },
  detail: {
    getAuditType () {         //     获取审核类型
      return fetch('/api/mApp/installment/user/v2/autoAuditOrHand', {}, 'post')
    },
    getApplyType () {      //   获取申请类型
      return fetch('/api/mApp/installment/user/v2/getApplyType')
    },
    detail () {            //  获取审核详情
      return fetch('/api/mApp/installment/user/v2/detail', {}, 'post')
    },
    addition () {            //   补充信息
      return fetch('/api/mApp/installment/user/v2/addition')
    }
  },
  auth: {
    businessValidate (validateUrl = '') {             // 校验预授权传操作人是不是商品订单本人
      return fetch('/api/quota/authorize/businessValidate', {validateUrl})
    },
    getUserInfo () {                //  获取用户名和头像
      return fetch('/api/quota/authorize/getUserInfo', {})
    },
    preAuth (subId = '01', baitiaoQuota	= 0, callbackUrl = '', apiType = 1) {       // 白条额度授权
      return fetch('/api/quota/authorize/authorization', {subId, baitiaoQuota, callbackUrl, apiType})
    },
    checkPayPwd (pwd = 1) {                   //  密码支付校验
      return fetch('/api/mApp/installment/user/v2/checkPayPwd', {pwd})
    },
    getAuthorizeQuota (authorizationId = '01') {    // 获取额度
      return fetch('/api/quota/authorize/getAuthorizeQuota', {authorizationId})
    }
  }
}
